package com.example.spring;

import com.example.spring.bean3.MyDataSource;

import com.example.spring.bean3.Product;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * ClassName:test02
 * Package:com.example.spring
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/5/10-8:32
 * @Version:v1.0
 */
public class test02 {
    @Test
    public void test01() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring3.xml");
        Product user = applicationContext.getBean("product", Product.class);
        System.out.println(user);
    }

    @Test
    public void name() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring3.xml");
        MyDataSource myDataSource = applicationContext.getBean("myDataSource", MyDataSource.class);
        System.out.println(myDataSource);
    }
}
